package TimeLimit;

import java.util.Date;
import java.util.Timer;
import java.util.TimerTask;

import net.rim.blackberry.api.phone.*;
import net.rim.device.api.ui.container.FlowFieldManager;
import net.rim.device.api.ui.component.LabelField;
import net.rim.device.api.ui.component.Status;
import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.system.*;



public final class ACHA extends Application implements PhoneListener{
	
    static public void main(String[] args)
    {
        ACHA miApp = new ACHA();
        miApp.enterEventDispatcher();
    }
    
    private ACHA()
    {
        Phone.addPhoneListener(this);
    }
    
    private void Contador(int ID){
        //PhoneCall Llamada = Phone.getCall(ID);
        long TiempoInicial = System.currentTimeMillis();
        //int TiempoLlam = 0;
    	Status.show("ACHA: Timer Initiated",Bitmap.getPredefinedBitmap(Bitmap.INFORMATION),2000);
    	long Tiempo = (System.currentTimeMillis() - TiempoInicial)/100;
    	Status.show("ACHA: Tiempo Transcurrido "+Long.toString(Tiempo),Bitmap.getPredefinedBitmap(Bitmap.INFORMATION),2000); 
     }
    
    public void callAdded(int callId)
    {
    }
    
    public void callAnswered(int callId)
    {
    }
    
    public void callConferenceCallEstablished(int callId)
    {
    }
    
    public void callConnected(int callId)
    {
    }
    
    public void callDirectConnectConnected(int callId)
    {
    }
    
    public void callDirectConnectDisconnected(int callId)
    {
    }
    
    public void callDisconnected(int callId)
    {
    }
    
    public void callEndedByUser(int callId)
    {
    }
    
    public void callHeld(int callId)
    {
    }
    
    public void callIncoming(int callId)
    {
    }
    
    public void callInitiated(int callid)
    {
        Contador(callid);
    }
    
    public void callRemoved(int callId)
    {
    }
    
    public void callResumed(int callId)
    {
    }
    
    public void callWaiting(int callid)
    {
    }
    
    public void conferenceCallDisconnected(int callId)
    {
    }
    
    public void callFailed(int callId, int reason)
    {
    }
}